

rating = zeros(size(snapDates));

%snapDates = [    729725;       730090];

snapDates = [    729999;       730090];
  
dTemp = [            0
      729725
      729756
      729787
      729815
      729846
      729876
      729907
      729937
      729968
      729999
      730029
         Inf ];
     
     rTemp = [

   NaN
     5
     5
     5
     5
     5
     5
     5
     7
     7
     7
     7];

for i = 1:length(dTemp)-1
    
    startt = snapDates >= dTemp(i);
    endt = snapDates < dTemp(i+1);
    thisIndex = startt & endt;
    
    
    rating(thisIndex) = rTemp(i);%?????
end

if snapDates(2)> dTemp(length(dTemp)-1)
    rating(2) = NaN;
end

